Refactor HTML to remove type attribute from style tags#1294
Refactor HTML to remove type attribute from style tags#1294pardeyke wants to merge 1 commit intobasecamp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aligns the project’s HTML/CSS inclusion patterns with modern HTML standards by removing the redundant type="text/css" attribute from <style> and stylesheet <link> tags across source, docs, test fixtures, and the Action Text bundled build.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Removed
type="text/css"from dynamically created<style>elements used for per-custom-element default CSS. - Updated test fixtures and test helper HTML-injection to use bare
<style>tags. - Updated documentation and static HTML assets to omit
type="text/css"on stylesheet links and style blocks.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/trix/core/helpers/custom_elements.js | Stops setting type="text/css" on injected <style> elements (keeps nonce + data attributes intact). |
| action_text-trix/app/assets/javascripts/trix.js | Mirrors the same removal in the bundled Action Text JS artifact. |
| src/test/test_helper.js | Updates global test <style> injection to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_styled_content.js | Updates fixture <style> tag to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_bold_styles.js | Updates fixture <style> tag to omit the type attribute. |
| src/test/test_helpers/fixtures/editor_with_block_styles.js | Updates fixture <style> tag to omit the type attribute. |
| README.md | Updates CDN usage example to omit type="text/css" on the stylesheet link. |
| assets/test.html | Updates stylesheet link to omit type="text/css". |
| assets/index.html | Updates stylesheet link and inline <style> to omit type="text/css". |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Verified: 1. style tagThe W3C validator does indeed flag this attribute:
2. link taghttps://html.spec.whatwg.org/multipage/links.html#link-type-stylesheet says
|
This pull request standardizes the way CSS stylesheets and style elements are included throughout the project by removing the unnecessary
type="text/css"attribute from<link>and<style>tags. This change simplifies the code and aligns with current HTML standards, as specifying the type is no longer required.